package com.ifreshwing.activity.mine;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.ifreshwing.activity.base.BaseActivity;
import com.ifreshwing.userpark.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by lz on 2017/4/28.
 * 版权声明
 */

public class CopyrightStatementActivity extends BaseActivity {
    @BindView(R.id.titleBar_back)
    ImageView titleBarBack;
    @BindView(R.id.titleBar_text)
    TextView titleBarText;
    @BindView(R.id.webView)
    WebView webView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_copyrightstatement);
        ButterKnife.bind(this);
        webView.loadUrl("http://www.baidu.com");
        titleBarText.setText("版权声明");
        titleBarBack.setVisibility(View.VISIBLE);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                view.loadUrl(request.getUrl().toString());
                return true;
            }
        });
    }

    @OnClick(R.id.titleBar_back)
    public void onViewClicked() {
        finish();
    }
}
